package com.liuzhihang.doc.view.dto;


import com.intellij.psi.PsiElement;
import org.apache.commons.lang3.ObjectUtils;

import java.util.List;

/**
 * @author fpc 改造
 * @date 20250507
 */
public class Body {

   // 序号	参数名	参数类型	长度	是否必须	默认值	备注

    /**
     * 序号
     */
    private String  sqno;

    /**
     * 参数的 psiElement
     */
    private PsiElement psiElement;

    /**
     * 是否必须
     */
    private Boolean required;
    /**
     * 参数名
     */
    private String name;
    /**
     * 参数示例
     */
    private String example;

    /**
     * 参数描述
     */
    private String desc;

    /**
     * 类型
     */
    private String type;

    /**
     * 长度
     */
    private String  length;

    private List<Body> bodyList;





    public Boolean getRequired() {
        return required;
    }

    public void setRequired(Boolean required) {
        this.required = required;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getExample() {
        return example;
    }

    public void setExample(String example) {
        this.example = example;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public List<Body> getBodyList() {
        return bodyList;
    }

    public void setBodyList(List<Body> bodyList) {
        this.bodyList = bodyList;
    }

    public PsiElement getPsiElement() {
        return psiElement;
    }

    public void setPsiElement(PsiElement psiElement) {
        this.psiElement = psiElement;
    }


    public String getLength() {
        if(ObjectUtils.isEmpty(length)){
            return "";
        }
        return length;
    }

    public void setLength(String length) {
        this.length = length;
    }

    public String getSqno() {
        return sqno;
    }

    public void setSqno(String sqno) {
        this.sqno = sqno;
    }
}
